<me:UIWB19 x:Class="WPFExcelReport.TWB19X"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                   xmlns:ChartEx="clr-namespace:WPFExcelReport.Chart;assembly=ITXVIEWS"  
                   x:Name="TV"
                   FTAUTOSUM="True"
                   SKEY1="WBFVERSION" 
                   KEY1="WBFQPKT"   
                    Loaded="Window_Loaded"
     >
    <me:UIWB19.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:SDKEYCONV x:Key="sd"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIWB19.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="240"></ColumnDefinition>
            <ColumnDefinition Width="190"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TabControl Grid.Row="0" Grid.RowSpan="3"  Grid.Column="0">
            <TabItem Header="{Binding Source={Localization:Translate Word=疵点}}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <DataGrid  Grid.Row="1"   
                           VerticalAlignment="Top"  
                           AutoGenerateColumns="False"
                           EnableRowVirtualization="False"
                           IsReadOnly="True"
                           VerticalScrollBarVisibility="Auto"
                           HorizontalScrollBarVisibility="Auto"
                           HeadersVisibility="Column"     
                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                           IsSynchronizedWithCurrentItem="True" 
                           x:Name="dlgMaster"  
                               RowHeight="45"
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"
                    >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=WBFFPOS}" Header="序"  Width="20" />
                            <DataGridTextColumn Binding="{Binding Path=WBFQPKT}" Header="分"  Width="20" />
                            <DataGridTextColumn Binding="{Binding Path=WBFFSCHL,Converter={StaticResource sd},ConverterParameter=0267}" Header="疵"  Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=WBFLGVON,Converter={StaticResource d1000}}" Header="始"  Width="30" />
                            <DataGridTextColumn Binding="{Binding Path=WBFLGBIS,Converter={StaticResource d1000}}" Header="至"  Width="30" />
                            <DataGridTextColumn Binding="{Binding Path=WBFBRTBIS,Converter={StaticResource d1000}}" Header="左"  Width="30" />
                            <DataGridTextColumn Binding="{Binding Path=WBFMARKART}" Header="班"  Width="Auto" Visibility="Collapsed" />

                        </DataGrid.Columns>
                    </DataGrid  >
                    <WrapPanel Grid.Row="2">
                        <TextBlock Text="{Binding Source={Localization:Translate Word=总分:}}"  Margin="20,0,0,0"></TextBlock>
                        <TextBlock Text="{Binding SUM1}" Foreground="Red" Margin="20,0,0,0"/>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=个数:}}"  Margin="20,0,0,0"></TextBlock>
                        <TextBlock Text="{Binding Counts1}" Foreground="Red" Margin="20,0,0,0"/>
                    </WrapPanel>
                </Grid>
            </TabItem>
            <TabItem Header="{Binding Source={Localization:Translate Word=统计}}">
                <ChartEx:ChartEx0008   Name="Chart08" />
            </TabItem>
        </TabControl>
        <WrapPanel Grid.Row="0" Grid.Column="1" MaxWidth="220">
            <WrapPanel> 
                <Button   Click="DFCommand" Height="40"  Margin="5,0,0,5" Width="40" VerticalAlignment="Center" ToolTip="主疵点">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/color.png" />
                    </Button.Background>
                </Button>
                <Button   Click="DeleteCommand" Height="60"  Margin="5,0,0,5" Width="40" VerticalAlignment="Center" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                    </Button.Background>
                </Button>
                <Button   Click="NewCommand" Height="60"   Margin="5,0,0,5"
                      Width="40" VerticalAlignment="Center" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                    </Button.Background>
                </Button>
                <Button Margin="10,0,0,0" FontSize="16" Content="{Binding Source={Localization:Translate Word=其他疵点}}" Name="chkAll" Height="60" Click="chkAll_Click" Width="Auto" ></Button>
            </WrapPanel>
        </WrapPanel>
        <StackPanel Grid.Row="2" Grid.Column="1" MaxWidth="240" >
            <WrapPanel Margin="0,10,0,0">
                <Button  Grid.Row="1" Grid.Column="1"  Margin="0,0,0,0" FontSize="18" Click="SaveCommand"   Visibility="Collapsed" Content="{Binding Source={Localization:Translate Word=疵点:}}" Height="60" Width="100"/>
                <!--<ex:TXT72 PRE="000" MaxLength="3" Text="{Binding WBFFSCHL}" Width="80"/>-->
                <SD:K0267 Grid.Row="1" Grid.Column="2"   Width="70" Margin="10" Visibility="Collapsed"
                              IsEdit="{Binding IsEdit,ElementName=TV}"
                              EXAUF="{Binding ERKEY,ElementName=TV}"
                              KEY="{Binding EKEY,ElementName=TV}"  />
                <Button   Click="SaveCommand" Height="60"   Margin="5,0,0,0"
                      Width="60" VerticalAlignment="Center" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
            <WrapPanel  Margin="0,10,0,0">
                <Button  Grid.Row="1" Grid.Column="3" Margin="0,0,0,0" FontSize="18" Content="{Binding Source={Localization:Translate Word=个/条:}}" Height="60" Width="100"/>
                <ex:NumericBox  Grid.Row="1" Grid.Column="4" Margin="5,0,0,0"  
                            FontSize="24" Text="{Binding WBFQPKT}" Maximum="4" Height="60" Width="40" />
               
            </WrapPanel>

            <WrapPanel  Margin="0,10,0,0">
                <Button  Grid.Row="3" Grid.Column="1" FontSize="18" 
                     Margin="0,0,0,0" Content="{Binding Source={Localization:Translate Word=开始}}" Click="StartError" Height="60" Width="100"/>
                <ex:NumericBox  Grid.Row="3" Grid.Column="2"   FontSize="24" DecimalPlaces="2" VerticalAlignment="Center"
                            Text="{Binding WBFLGVON,Converter={StaticResource d1000}}" Width="80" Height="60" />
            </WrapPanel>
            <WrapPanel  Margin="0,10,0,0">
                <Button   Grid.Row="3" Grid.Column="3"  Margin="0,0,0,0" FontSize="18"
                      Content="{Binding Source={Localization:Translate Word=长度(cm)}}"  Click="EndError" Height="60" Width="80"/>
                <ex:NumericBox   FontSize="24" DecimalPlaces="2" Name="cLG"
                            Text="{Binding ERRLNG,Converter={StaticResource d10},ElementName=TV}" Height="60" Width="80" /> 
                
            </WrapPanel>
            <WrapPanel  Margin="0,10,0,0">
                <Button   Grid.Row="3" Grid.Column="3"  Margin="0,0,0,0" FontSize="18"
                      Content="{Binding Source={Localization:Translate Word=结束}}"  Click="EndError" Height="60" Width="100"/>
                <ex:NumericBox  Grid.Row="3" Grid.Column="4"  FontSize="24" DecimalPlaces="2"
                            Text="{Binding WBFLGBIS,Converter={StaticResource d1000}}" Width="80" Height="60" />
            </WrapPanel>
            <WrapPanel  Margin="0,10,0,0">
                <Button   Grid.Row="4" Grid.Column="1"  Margin="0,0,0,0" FontSize="18" Height="60" Width="100"
                      Content="{Binding Source={Localization:Translate Word=左起}}"/>
                <ex:NumericBox  Grid.Row="4" Grid.Column="2" FontSize="24" 
                            Text="{Binding WBFBRTVON,Converter={StaticResource d1000}}" Width="80" Height="60"  />

            </WrapPanel>
            <WrapPanel Margin="0,10,0,0">
                <Button   Grid.Row="4" Grid.Column="3" Margin="0,0,0,0" FontSize="18" 
                      Content="{Binding Source={Localization:Translate Word=左至}}" Height="60" Width="100"/>
                <ex:NumericBox  Grid.Row="4" Grid.Column="4" FontSize="24"
                            Text="{Binding WBFBRTBIS,Converter={StaticResource d1000}}" Height="60" Width="80"/>
            </WrapPanel>
            <WrapPanel HorizontalAlignment="Left">
                <Button   Click="SaveCommand" Height="60"  Margin="0,0,0,0" Width="180" Content="疵点保存" Background="Yellow" FontSize="26" VerticalAlignment="Center" > 
                </Button>
            </WrapPanel>
           
        </StackPanel>

        <!--<SD:KL267 Grid.Row="0"  Grid.RowSpan="3" Grid.Column="2"  IsCombo="False"
                  KEY="{Binding EKEY,ElementName=TV}"
                  />-->
        <SD:ERKBOX Grid.Row="0" Grid.RowSpan="3" Grid.Column="2"
                    IsChkAll="{Binding IsChkAll,ElementName=TV}"
                    EKEY="{Binding EKEY,ElementName=TV}"
                   /> 
    </Grid>
</me:UIWB19>
